package com.itHsuSE.demo5;

public class Test1 {
    public static void main(String[] args) {
        CellPhone cellPhone=new CellPhone();
        cellPhone.ring(new Bell() {
            @Override
            public void ring() {
                System.out.println("懒猪起床啦");
            }
        });

        cellPhone.ring(new Bell() {
            @Override
            public void ring() {
                System.out.println("上课了");
            }
        });
    }
}

interface Bell{
    void ring();
}

class CellPhone{
    public void ring(Bell bell){
        bell.ring();
    }
}